package com.nmsl.medicine.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.nmsl.common.annotation.Excel;
import com.nmsl.common.core.domain.BaseEntity;
import org.springframework.beans.factory.annotation.Value;

import java.util.Date;

/**
 * 入库详情记录对象 storage_in_detail_record
 * 
 * @author ruoyi
 * @date 2025-02-19
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class StorageInDetailRecord extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 入库记录详情id */
    private Long storageInDetailId;

    /** 入库单号（药品入库记录表） */
    private Long storageInId;

    /** 药品id（药品表） */
    private Long medicineId;

    /** 入库数量 */
    private Long storageInQuantity;

    /** 药品名称  **/
    private String medicineName;

    /** 药品类别 **/
    private String categoryName;


    /** 药品规格 */
    private String medicineSpecification;

    /** 生产厂家 */
    private String manufacturerName;

    /** 采购价 */
    private Double purchasePrice;

    /** 零售价 */
    private Double retailPrice;

    /** 采购总价 **/
    private Double AllpurchasePrice;

    /** 售卖总价 **/
    private Double AllRetailPrice;


    /** 药品有效期 */
    @JsonFormat(pattern ="yyy-MM-dd")
    private Date validityPeriod;

//    计算总价
    public void getAll(){

        this.AllpurchasePrice=this.purchasePrice*this.storageInQuantity;
        this.AllRetailPrice=this.retailPrice*this.storageInQuantity;
    }
}
